<?php
include("../utility/connection.php");
include("../model/mUser.php");
session_start();

if($_SERVER["REQUEST_METHOD"] == "POST") {
    $userId = trim(mysql_real_escape_string($_POST["hidIdUser"]));
    $result = fnSelectUser($userId);
    $count = mysql_num_rows($result); // number of row
    $userResult = mysql_fetch_array($result);
    
    if ($count == 1) {
        $_SESSION['userId']=$userId;
        $_SESSION['userResult']=$userResult;
        header("location: ../ui/admin/userAdmin.php");
    } else {
        $_SESSION['userId']=$userId;
        unset($_SESSION['userResult']);
        header("location: ../ui/admin/userAdmin.php");
    }
}
?>
